package com.qf.hmadmin.crueManagement.mark.service.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.qf.hmadmin.crueManagement.mark.dao.MarkDao;
import com.qf.hmadmin.crueManagement.mark.param.MarkPageParam;
import com.qf.hmadmin.crueManagement.mark.service.MarkService;
import com.qf.hmadmin.crueManagement.mark.vo.AddMarkActive;
import com.qf.hmadmin.crueManagement.mark.vo.MarkVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Mark)表服务实现类
 *
 * @author makejava
 * @since 2024-10-05 23:01:21
 */
@Service("markService")
public class MarkServiceImpl implements MarkService {
    @Resource
    private MarkDao markDao;


    @Override
    public PageInfo<MarkVO> pageMark(MarkPageParam markPageParam) {

        PageHelper.startPage(markPageParam.getPageNum(),markPageParam.getPageSize());
        List<MarkVO>  list = markDao.selectAllMark(markPageParam);
        PageInfo<MarkVO> markVOPageInfo = new PageInfo<>(list);

        return  markVOPageInfo;

    }

    @Override
    public Boolean deleteMark(Integer id) {

       Boolean isOk =  markDao.deleteMark(id);

        return isOk;
    }

    @Override
    public Boolean deleteMarkBatch(List<Integer> ids) {

      Boolean isOk =   markDao.deleteMarkBatch(ids);

      return isOk;
    }

    @Override
    public Boolean addMarkActive(AddMarkActive addMarkActive) {

       boolean  isOk =  markDao.addMarkActive(addMarkActive);
        return isOk;
    }
}
